﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace XML
{
    public partial class DeserializeForm : Form
    {
        ProductsDal productDal = new ProductsDal();

        List<Model.products> productList = null;
        public DeserializeForm()
        {
            InitializeComponent();
        }

        private void DeserializeForm_Load(object sender, EventArgs e)
        {
            DataSet productsDataSet = productDal.GetList("");

            productList = productDal.DataTableToList(productsDataSet.Tables[0]);

            foreach (Model.products product in productList)
            {
                listProduct.Items.Add(product.product_id + ":" + product.product_name);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            RoleRelationshipDal relationDal = new RoleRelationshipDal();

            RoleSet roleSet = XmlHelper.XmlDeserialize<RoleSet>(richTextBox1.Text, Encoding.UTF8);


        }
    }
}
